package com.yzt.zhuju.widget.emticonnskeyboard;

import android.text.TextPaint;
import android.text.style.MetricAffectingSpan;

import java.io.Serializable;

/**
 * User: fish
 * E-mail: 709913163@qq.com
 * Date: 2022/4/18
 * Time: 10:51
 * describe:
 */
public class CommTextSpan extends MetricAffectingSpan implements Serializable {

    protected String libleId;//插入块内容的id
    protected String libleName;//插入块的内容，不带前缀的
    protected String showText;//文本内容
    protected int type;//0 文本，其余的自行定义
    protected int newType;//新旧数据的一个区分，针对二次编辑使用
    protected Integer start;//插入的开始位置
    protected Integer end;//插入后的位置
    protected int spanColor;//插入块的颜色

    public CommTextSpan(String showText) {
        this.showText = showText;
    }

    /**
     *
     * @param libleId
     * @param libleName
     * @param showText
     * @param type
     */
    public CommTextSpan(String libleId, String libleName, String showText, int type) {
        this.libleId = libleId;
        this.libleName = libleName;
        this.showText = showText;
        this.type = type;
    }

    /**
     *
     * @param libleId
     * @param libleName
     * @param color
     * @param showText
     * @param type
     */
    public CommTextSpan(String libleId, String libleName,int color, String showText, int type) {
        this.libleId = libleId;
        this.libleName = libleName;
        this.showText = showText;
        this.type = type;
        this.spanColor=color;
    }

    /**
     *
     * @param showText
     * @param libleId
     * @param libleName
     * @param type
     * @param newType
     */
    public CommTextSpan(String showText,String libleId, String libleName,  int type, int newType) {
        this.libleId = libleId;
        this.libleName = libleName;
        this.showText = showText;
        this.type = type;
        this.newType = newType;
    }

    public Integer getStart() {
        return start;
    }

    public void setStart(Integer start) {
        this.start = start;
    }

    public Integer getEnd() {
        return end;
    }

    public void setEnd(Integer end) {
        this.end = end;
    }

    public int getSpanColor() {
        return spanColor;
    }

    public void setSpanColor(int spanColor) {
        this.spanColor = spanColor;
    }

    public String getLibleId() {
        return libleId;
    }

    public void setLibleId(String libleId) {
        this.libleId = libleId;
    }

    public String getLibleName() {
        return libleName;
    }

    public void setLibleName(String libleName) {
        this.libleName = libleName;
    }

    public String getShowText() {
        return showText;
    }

    public void setShowText(String showText) {
        this.showText = showText;
    }

    public int getType() {
        return type;
    }

    public void setType(int type) {
        this.type = type;
    }

    public int getNewType() {
        return newType;
    }

    public void setNewType(int newType) {
        this.newType = newType;
    }


    @Override
    public void updateMeasureState(TextPaint p) {

    }

    @Override
    public void updateDrawState(TextPaint tp) {

    }
}
